Importation of data is an important feature of any server-based product that manages data, including ERP systems. In particular, within enterprise resource planning systems that include relational database applications, there is often a need for the ERP application to support referential integrity. For example, one or more columns within a table may each refer to one or more columns in one or more other tables.
Each row within a table may include a unique identification value (e.g., record identification values) that uniquely distinguishes the row from other rows within the table. Data records may also use the record identification values of other data records to establish a referential relationship between the data records. The record identification values may be provided by maintaining a monotonically increasing counter for each record identification set. When a new unique record identification value is generated, the counter is incremented and the value is returned as the next record identification value.
However, during importation record identification conflicts may occur. For example, data imported from a different source may include record identification values that already exist in the target ERP system. Further, it is possible that record identification values may be lost or discarded, causing record identification fragmentation (e.g., gaps). The non-consecutive values resulting from fragmentation may be undesirable when directly copying the record identification values to the target system, because the record identification values corresponding to the gaps may not be regained, the number of available record identification values may be quickly exhausted.
To address record identification fragmentation, the record identification values of an import set may be replaced with a new set of record identification values in the target system. However, the integrity of data relationships should be maintained when replacing the record identification values. Although referential integrity may be maintained by processing each row individually and updating each record identification reference with the new record identification values, such a process may be inefficient.
When assigning new record identification values during importation to an ERP system, relational and referential integrity between and among data records within different tables should be maintained. Further, relational and referential integrity should be maintained within a set-based importation process, while maintaining efficiency with the importation process.